<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
<%@ include file="../../common/common.jsp" %>	
<%@ include file="master_pass.jsp" %>
<% 	
masterLogin.hasPermission(1004);
//权限判断代码结束
IContentFilterService contentFilterService = (IContentFilterService)BeanManager.getBean("contentFilterService");
contentFilterService.AutoBindingTable(request);
%>


<html>
<head>
<title><%=SYSTITLE%> - 社区内容过滤管理</title>
<%@ include file="../../common/meta.inc" %>
<link href="css.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/extremetable/extremecomponents.css"/>
<SCRIPT LANGUAGE="javascript" SRC="${pageContext.request.contextPath}/scripts/common-validator.js"></SCRIPT>
<script language="javascript" src="${pageContext.request.contextPath}/scripts/prototype.js"></script>
<script language="javascript" src="${pageContext.request.contextPath}/scripts/buffalo/buffalo.js"></script>
<script language="javascript">
function newInfo()
{
	if(showModalDialog('content_filter_new.jsp', '', 'dialogWidth:450px;dialogHeight:300px;status:0;help:0') != null)
	{
		sl_update_ok();
		location.reload();
	}
}

function updateInfo(id)
{
	if(showModalDialog('content_filter_update.jsp?cfId='+id, '', 'dialogWidth:450px;dialogHeight:300px;status:0;help:0') != null)
	{
		sl_update_ok();
		location.reload();
	}
}

function deleteInfo(id)
{
	if(!sl_confirm('删除选定的记录')) return false;
	
	var END_POINT="${pageContext.request.contextPath}/buffalo";
	var buffalo = new Buffalo(END_POINT);
	var obj = parseInt(id);
	buffalo.remoteCall("contentFilterServiceAjaxService.delete",[obj], function(reply) {
        ajaxSubmit(reply.getResult(),"删除成功！","reload");        
    });
	
}
</script>
</head>
<body leftMargin=5 topMargin=10 rightmargin="0" bottommargin="0" >
<table width="99%" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#e6e6e6">
  <tr>
    <td align="center"><strong>配置社区内容过滤</strong></td>
  </tr>
</table>
	<ec:table 
		items="resultList"
		var="rs"	
		retrieveRowsCallback="limit"
        sortRowsCallback="limit"			
		action="${pageContext.request.contextPath}/club/admin/content_filter.jsp"		
		title="社区内容过滤"
		>	
		<ec:row>
				<ec:column property="CF_ID" title="序号" >
					<input type="checkbox" name="cfId" value="${rs.CF_ID}">${rs.CF_ID}
				</ec:column>
				<ec:column property="FILTER_TYPE_NAME" title="过滤类型" />
				<ec:column property="SOURCE_STR" title="需要替换的内容" />
				<ec:column property="REPLACE_STR" title="替换后的内容" />
				<ec:column property="1" title="操作" width="15%">
					<input type="button" name="btnEdit" value="编辑" onclick="javascript:updateInfo(${rs.CF_ID})">
					&nbsp;&nbsp;
					<input type="button" name="btnEdit" value="删除" onclick="javascript:deleteInfo(${rs.CF_ID})">
				</ec:column>
		</ec:row>
	</ec:table>
			<table border="0" width="100%">
				<tr valign="top">
					<td align="right">
					<button class="btn" accessKey=n id="btnNew" name="btnNew" title="新建记录" onclick="javascript:newInfo();">新建(<u>N</u>)</button>
					&nbsp;&nbsp;&nbsp; 
					<button class="btn" accessKey=r id="btnRefresh" name="btnRefresh" title="刷新当前页面" onclick="javascript:location.reload();this.disabled=true;">刷新(<u>R</u>)</button>
					&nbsp;&nbsp;&nbsp;<td>
				</tr>
			</table>	
</body>
</html>
